/* UI Widgets Handling */

function onInitialize(){
	
};	

function onErrors(err){
	//alert(err);
	$zxtUI.__messager.setMessage(err);	
};

function onClick$Query(){
	queryWithCardId();
};

function onClick$Reset(){
	alert($zxt.translate("PROMPT"));
};

function onClick$Update(){
	updateWithCardId();
};

/* Logic Details */

function queryWithCardId(){
	var callback = { 
		onSuccess: function(ei){
			ei.populateComponents();					
			$zxtUI.__messager.setMessage(ei.message());			
		},
		onFailure: function(xmlR, status, e){ alert("ERROR"); }
	}; 

	
	var dw = new zxt.data.DataWrapper();	
	dw.addComponent("CardID");		
	$zxt.commit(dw, callback);
}	

function updateWithCardId(){
	var callback = { 
		onSuccess: function(ei){
			$zxtUI.__messager.setMessage(ei.message());			
		},
		onFailure: function(xmlR, status, e){ alert("ERROR"); }
	}; 

	
	var dw = new zxt.data.DataWrapper();
	dw.addComponents();	
	$zxt.commit(dw, callback);
}	